<template>
  <div :ref="refName" class="con" :style="{flexDirection:direction,height:conH+'px'}">
    <slot />
  </div>
</template>
<script>
import { getMinH } from '@/utils/public.js'
export default {
  props: {
    refName: {
      type: String,
      default: 'con'
    },
    direction: {
      type: String,
      default: 'column'
    },
    m_bottom: { // 距离可视区底部的距离
      type: Number,
      default: 0
    }
  },
  data() {
    return {
      conH: 0
    }
  },
  mounted() {
    try {
      this.getH()
      window.addEventListener('resize', this.getH)
    } catch (e) {
      console.log('Content', e)
    }
  },
  updated() {
    this.getH()
  },
  destroyed() {
    window.removeEventListener('resize', this.getH)
  },
  methods: {
    getH() {
      this.$nextTick(() => {
        this.conH = getMinH(this, this.refName)
      })
    }
  }
}
</script>

<style lang="scss" >
	.con{
		background-color: #FFFFFF;
		display: flex;
		box-sizing: border-box;
		overflow-y: auto;
	}
</style>
